Integrand size = 26, antiderivative size = 667 \[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {b (e+f x)^2 \log \left (1+e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d}+\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}-\frac {i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 a f^2 \operatorname {PolyLog}\left (3,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}+\frac {2 a f^2 \operatorname {PolyLog}\left (3,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}+\frac {b f^2 \operatorname {PolyLog}\left (3,-e^{2 i (c+d x)}\right )}{2 \left (a^2-b^2\right ) d^3} \]
[Out]
Time = 0.79 (sec) , antiderivative size = 667, normalized size of antiderivative = 1.00, number of steps used = 24, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.346, Rules used = {4629, 4615, 2221, 2611, 2320, 6724, 6874, 4266, 3800} \[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{d \left (a^2-b^2\right )}-\frac {2 a f^2 \operatorname {PolyLog}\left (3,-i e^{i (c+d x)}\right )}{d^3 \left (a^2-b^2\right )}+\frac {2 a f^2 \operatorname {PolyLog}\left (3,i e^{i (c+d x)}\right )}{d^3 \left (a^2-b^2\right )}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{d^3 \left (a^2-b^2\right )}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{d^3 \left (a^2-b^2\right )}+\frac {b f^2 \operatorname {PolyLog}\left (3,-e^{2 i (c+d x)}\right )}{2 d^3 \left (a^2-b^2\right )}+\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{d^2 \left (a^2-b^2\right )}-\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{d^2 \left (a^2-b^2\right )}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{d^2 \left (a^2-b^2\right )}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{d^2 \left (a^2-b^2\right )}-\frac {i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right )}{d^2 \left (a^2-b^2\right )}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{d \left (a^2-b^2\right )}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{d \left (a^2-b^2\right )}+\frac {b (e+f x)^2 \log \left (1+e^{2 i (c+d x)}\right )}{d \left (a^2-b^2\right )} \]
[In]
[Out]
Rule 2221
Rule 2320
Rule 2611
Rule 3800
Rule 4266
Rule 4615
Rule 4629
Rule 6724
Rule 6874
Rubi steps \begin{align*} \text {integral}& = \frac {\int (e+f x)^2 \sec (c+d x) (a-b \sin (c+d x)) \, dx}{a^2-b^2}-\frac {b^2 \int \frac {(e+f x)^2 \cos (c+d x)}{a+b \sin (c+d x)} \, dx}{a^2-b^2} \\ & = \frac {i b (e+f x)^3}{3 \left (a^2-b^2\right ) f}+\frac {\int \left (a (e+f x)^2 \sec (c+d x)-b (e+f x)^2 \tan (c+d x)\right ) \, dx}{a^2-b^2}-\frac {b^2 \int \frac {e^{i (c+d x)} (e+f x)^2}{a-\sqrt {a^2-b^2}-i b e^{i (c+d x)}} \, dx}{a^2-b^2}-\frac {b^2 \int \frac {e^{i (c+d x)} (e+f x)^2}{a+\sqrt {a^2-b^2}-i b e^{i (c+d x)}} \, dx}{a^2-b^2} \\ & = \frac {i b (e+f x)^3}{3 \left (a^2-b^2\right ) f}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {a \int (e+f x)^2 \sec (c+d x) \, dx}{a^2-b^2}-\frac {b \int (e+f x)^2 \tan (c+d x) \, dx}{a^2-b^2}+\frac {(2 b f) \int (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right ) \, dx}{\left (a^2-b^2\right ) d}+\frac {(2 b f) \int (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right ) \, dx}{\left (a^2-b^2\right ) d} \\ & = -\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {(2 i b) \int \frac {e^{2 i (c+d x)} (e+f x)^2}{1+e^{2 i (c+d x)}} \, dx}{a^2-b^2}-\frac {(2 a f) \int (e+f x) \log \left (1-i e^{i (c+d x)}\right ) \, dx}{\left (a^2-b^2\right ) d}+\frac {(2 a f) \int (e+f x) \log \left (1+i e^{i (c+d x)}\right ) \, dx}{\left (a^2-b^2\right ) d}-\frac {\left (2 i b f^2\right ) \int \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right ) \, dx}{\left (a^2-b^2\right ) d^2}-\frac {\left (2 i b f^2\right ) \int \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right ) \, dx}{\left (a^2-b^2\right ) d^2} \\ & = -\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {b (e+f x)^2 \log \left (1+e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d}+\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}-\frac {(2 b f) \int (e+f x) \log \left (1+e^{2 i (c+d x)}\right ) \, dx}{\left (a^2-b^2\right ) d}-\frac {\left (2 b f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,\frac {i b x}{a-\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}-\frac {\left (2 b f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,\frac {i b x}{a+\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}-\frac {\left (2 i a f^2\right ) \int \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right ) \, dx}{\left (a^2-b^2\right ) d^2}+\frac {\left (2 i a f^2\right ) \int \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right ) \, dx}{\left (a^2-b^2\right ) d^2} \\ & = -\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {b (e+f x)^2 \log \left (1+e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d}+\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}-\frac {i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}-\frac {\left (2 a f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}+\frac {\left (2 a f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}+\frac {\left (i b f^2\right ) \int \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right ) \, dx}{\left (a^2-b^2\right ) d^2} \\ & = -\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {b (e+f x)^2 \log \left (1+e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d}+\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}-\frac {i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 a f^2 \operatorname {PolyLog}\left (3,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}+\frac {2 a f^2 \operatorname {PolyLog}\left (3,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}+\frac {\left (b f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-x)}{x} \, dx,x,e^{2 i (c+d x)}\right )}{2 \left (a^2-b^2\right ) d^3} \\ & = -\frac {2 i a (e+f x)^2 \arctan \left (e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}-\frac {b (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d}+\frac {b (e+f x)^2 \log \left (1+e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d}+\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 i a f (e+f x) \operatorname {PolyLog}\left (2,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^2}-\frac {i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right )}{\left (a^2-b^2\right ) d^2}-\frac {2 a f^2 \operatorname {PolyLog}\left (3,-i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}+\frac {2 a f^2 \operatorname {PolyLog}\left (3,i e^{i (c+d x)}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right ) d^3}+\frac {b f^2 \operatorname {PolyLog}\left (3,-e^{2 i (c+d x)}\right )}{2 \left (a^2-b^2\right ) d^3} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(1461\) vs. \(2(667)=1334\).
Time = 3.79 (sec) , antiderivative size = 1461, normalized size of antiderivative = 2.19 \[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=\frac {1}{6} \left (\frac {2 \left (\frac {2 i b (e+f x)^3}{f}-\frac {3 (a-b) \left (1+e^{2 i c}\right ) (e+f x)^2 \log \left (1-i e^{-i (c+d x)}\right )}{d}+\frac {3 (a+b) \left (1+e^{2 i c}\right ) (e+f x)^2 \log \left (1+i e^{-i (c+d x)}\right )}{d}+\frac {6 (a+b) \left (1+e^{2 i c}\right ) f \left (i d (e+f x) \operatorname {PolyLog}\left (2,-i e^{-i (c+d x)}\right )+f \operatorname {PolyLog}\left (3,-i e^{-i (c+d x)}\right )\right )}{d^3}-\frac {6 i (a-b) \left (1+e^{2 i c}\right ) f \left (d (e+f x) \operatorname {PolyLog}\left (2,i e^{-i (c+d x)}\right )-i f \operatorname {PolyLog}\left (3,i e^{-i (c+d x)}\right )\right )}{d^3}\right )}{\left (a^2-b^2\right ) \left (1+e^{2 i c}\right )}+\frac {2 b \left (-6 i d^3 e^2 e^{2 i c} x-6 i d^3 e e^{2 i c} f x^2-2 i d^3 e^{2 i c} f^2 x^3-3 d^2 e^2 \log \left (b-2 i a e^{i (c+d x)}-b e^{2 i (c+d x)}\right )+3 d^2 e^2 e^{2 i c} \log \left (b-2 i a e^{i (c+d x)}-b e^{2 i (c+d x)}\right )-6 d^2 e f x \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}-\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )+6 d^2 e e^{2 i c} f x \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}-\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-3 d^2 f^2 x^2 \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}-\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )+3 d^2 e^{2 i c} f^2 x^2 \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}-\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-6 d^2 e f x \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )+6 d^2 e e^{2 i c} f x \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-3 d^2 f^2 x^2 \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )+3 d^2 e^{2 i c} f^2 x^2 \log \left (1+\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-6 i d \left (-1+e^{2 i c}\right ) f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (2 c+d x)}}{a e^{i c}+i \sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-6 i d \left (-1+e^{2 i c}\right ) f (e+f x) \operatorname {PolyLog}\left (2,-\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-6 f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (2 c+d x)}}{a e^{i c}+i \sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )+6 e^{2 i c} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (2 c+d x)}}{a e^{i c}+i \sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )-6 f^2 \operatorname {PolyLog}\left (3,-\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )+6 e^{2 i c} f^2 \operatorname {PolyLog}\left (3,-\frac {b e^{i (2 c+d x)}}{i a e^{i c}+\sqrt {\left (-a^2+b^2\right ) e^{2 i c}}}\right )\right )}{\left (-a^2+b^2\right ) d^3 \left (-1+e^{2 i c}\right )}-\frac {8 b x \left (3 e^2+3 e f x+f^2 x^2\right ) \csc ^3(c)}{(a-b) (a+b) \left (\csc \left (\frac {c}{2}\right )-\sec \left (\frac {c}{2}\right )\right ) \left (\csc \left (\frac {c}{2}\right )+\sec \left (\frac {c}{2}\right )\right )}\right ) \]
[In]
[Out]
\[\int \frac {\left (f x +e \right )^{2} \sec \left (d x +c \right )}{a +b \sin \left (d x +c \right )}d x\]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2035 vs. \(2 (588) = 1176\).
Time = 0.57 (sec) , antiderivative size = 2035, normalized size of antiderivative = 3.05 \[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=\int \frac {\left (e + f x\right )^{2} \sec {\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
\[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )}^{2} \sec \left (d x + c\right )}{b \sin \left (d x + c\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(e+f x)^2 \sec (c+d x)}{a+b \sin (c+d x)} \, dx=\text {Hanged} \]
[In]
[Out]